﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DevExpress.Xpf.Editors;

namespace sLightLibrary.BasicApp.Views.Controls.DataControls
{
    public class myTextEdit : TextEdit
    {
        public void FormatDisplayType(string type)
        {
            switch (type)
            {
                case "Text":
                    break;
                case "PhoneNumber":                    
                     this.Mask = @"\++[0-9]+\-[0-9]";
                    this.MaskType = MaskType.RegEx;
                    break;
                case "Email":
                    this.Mask = @"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}";
                    this.MaskType = MaskType.RegEx;
                    break;           
                case "IPAddress":
                    this.Mask = @"[0-9]+\.[0-9]+\.[0-9]{1,3}+\.[0-9]{1,3}";
                    this.MaskType = MaskType.RegEx;
                    break;
                default:
                    break;
            }
        }
    }
}
